package demo2;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Test1
{
    // 共享变量
    public static String content = "空";

    public static void main(String[] args)
        throws ExecutionException, InterruptedException
    {

        FutureTask<Integer> task = new FutureTask<>(()->
        {
                return 10;
        });

        new Thread(task).start();
        System.out.println(task.get());
    }

}
